//
//  FilterComomWidge.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2021/9/17.
//  Copyright © 2021 aowang. All rights reserved.
//

import UIKit

class FilterComomWidge: NSObject {

}
enum SlideType { // 时间区间   月份    单输入   单选 多选    金额区间  点击事件
    case dateRegion,monthX,singleInput,singleSelect,multiSelect,moneyRegion,actionClo
}
struct SlideContent {
    var param = "" // 参数值，用与传回去匹配使用
    var type:SlideType
    var title:String
    var disabled = false // 不可编辑
    var startDate:String = ""
    var endDate:String = ""
    var minMoney:String = ""
    var maxMoney:String = ""
    var inputStr:String = ""
    var dataArr:[SeString]? = nil // 如果是单选或多选类型必须要传
    var numberOfRow:Int = 2 // 每行的个数，和上面数组一起单选或多选类型必传
    var open:Bool? = nil // 不配置就没有 默认折叠
    var actionClo:((Int)->())? = nil // 按钮事件的传递
    var singleSelctClo:((Int,String)->())? = nil // 单选事件选择过程中的方法暴露(索引值,中文)，给外面处理逻辑
    
    // 新筛选 可以显示单独条件
    var isUserShow = true
  }


class SlideButton:UIButton {
    override func setTitle(_ title: String?, for state: UIControl.State) {
        super.setTitle(title, for: state)
        if title == "请输入" || title == "请选择" {
            self.setTitleColor(.lightGray, for: .normal)
        } else {
            self.setTitleColor(.black, for: .normal)
        }
    }
}
class SlideItemButton:UIButton {
    
    func setSelected(_ isselecteddd:Bool) {
        if isselecteddd {
            self.layer.borderWidth = 1
            self.layer.borderColor = UIColor(kshex: "#4972F9").cgColor
            self.setTitleColor(UIColor(kshex: "#4972F9"), for: .normal)
            self.backgroundColor = UIColor(kshex: "#CCE5FF")
        } else {
            self.layer.borderWidth = 0
            self.setTitleColor(UIColor(kshex: "#2A304A"), for: .normal)
            self.backgroundColor = UIColor(kshex: "#E5E8EE")

        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor(kshex: "#E5E8EE")
        self.layer.masksToBounds = true
        self.layer.cornerRadius = 5
        self.titleLabel?.font = UIFont.systemFont(ofSize: 14)
        self.setTitleColor(UIColor(kshex: "#2A304A"), for: .normal)
        
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
